package com.example.bootdemo1.service.impl;

import com.example.bootdemo1.dao.StudentDao;
import com.example.bootdemo1.pojo.Student;
import com.example.bootdemo1.service.IStudentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 宋伟宁
 * @Date 2023/10/24
 * @Version 1.0
 **/
@Service
public class StudentService implements IStudentService {

    @Resource
    private StudentDao studentDao;


    @Override
    public List<Student> findAll() {
        return this.studentDao.findAll();
    }

    @Override
    public int add(Student student) {
        return this.studentDao.saveAndFlush(student).getId();
    }
}
